package com.sgj.hello;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author 沈国纪
 * @date 2020/12/16 16:29
 */
@Component      // 默认创建的队列是 持久化、非独占、不是自动删除队列
@RabbitListener(queuesToDeclare = @Queue("hello"))
public class HelloCustomer {

    @RabbitHandler
    public void receive1(String message) {
        System.out.println("message = " + message);
    }
}
